home *** CD-ROM | disk | FTP | other *** search
-
- class Queue { // queue of integers
- public:
- // initialize the queue to empty
- Queue();
-
- // returns TRUE if the queue is empty, else FALSE
- Truth isempty();
-
- // returns TRUE if queue is full, else FALSE
- True isfull();
-
- // deletes and returns value at head of queue
- // precondition: !isempty()
- int gethead();
-
- // make x the new head of the queue
- void puthead( int x);
-
- // delete and return the last element in the queue
- // precondition: !isempty()
- int gettail();
-
- // make x the last element in the queue
- void puttail( int x);
- private:
- ...
- };
-
-